<%--
  Created by IntelliJ IDEA.
  User: lenovo
  Date: 2020/3/10
  Time: 20:35
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<html>
<style type="text/css">

</style>
<head>
    <title>List页面</title>
</head>
<body>
<form action="/user/findSome" method="post">
    用户名：<input type="text" name="username" value=""><br/><br/>
    性别：<input type="text" name="sex" value=""><br/><br/>
    生日：<input type="text" name="begin" value="">----<input type="text" name="end" value=""><br/><br/>
    部门：<input type="text" name="department" value="">
    <input type="submit" value="搜索">
</form>
<a href="/user/form">添加</a>
<table cellspacing="0" border="1">
    <thead>
        <tr>
            <th>姓名</th>
            <th>生日</th>
            <th>性别</th>
            <th>地址</th>
            <th>部门</th>
            <th>操作</th>
        </tr>
    </thead>
    <tbody>

            <c:forEach var="user" items="${userList}">
            <tr>
                <td>${user.username}</td>
                <td>${user.birthday}</td>
                <td>${user.sex}</td>
                <td>${user.address}</td>
                <td>${user.department}</td>
                <td>
                <a href="/user/updateForm/${user.UId}">更新</a>/
                <a href="/user/delete/${user.UId}">删除</a></li>
                </td>
            </tr>
            </c:forEach>

    </tbody>
</table>

<c:if test="${userPageInfo!=null}">
    <div>
        <a href="/user/pageList?pageNum=1">首页</a>
        <c:if test="${userPageInfo.hasPreviousPage}">
            <a href="/user/pageList?pageNum=${userPageInfo.prePage}">上一页</a>
        </c:if>
        <c:forEach begin="1" end="${userPageInfo.pages}" var="page" step="1">
            <a href="/user/pageList?pageNum=${page}">${page}</a>
        </c:forEach>
        <c:if test="${userPageInfo.hasNextPage}">
            <a href="/user/pageList?pageNum=${userPageInfo.nextPage}">下一页</a>
        </c:if>
        <a href="/user/pageList?pageNum=${userPageInfo.pages}">尾页</a>
    </div>
</c:if>
</body>
</html>
